import PikaStdLib
import PikaStdTask
import _thread
import threading, time
def rgb_task():
    print("rgb_task")


def led_task():
    print("led_task")

# taskm = PikaStdTask.Task()


# taskm.call_period_ms(rgb_task, 200)
# taskm.call_period_ms(led_task, 500)

# taskm.run_forever()
mem = PikaStdLib.MemChecker()
print('hello PikaScript 123213213!')

print('mem used max:')
mem.max()
print('mem used now:')
mem.now()

# lock = threading.Lock()
# print(lock._mutex_)
# res = lock.acquire(True, 0)
# print(res)
# print(type(res))
# print("res=%s" % True)
# print('mem used now:')
# mem.now()

# print(lock.locked())
def 

def create_threads():
    _thread.start_new_thread()
# for i in range(10):
#     lock = threading.Lock()
#     res = lock.acquire(True, 0)
#     lock.release()
#     print('before del mem used now:')
#     mem.now()
#     del lock
#     print('after del mem used now:')
#     mem.now()
#     time.sleep(1)